package com.hanamaki.study.day02;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class SeleniumTemplate {

    //注册驱动
    WebDriver driver;

    @BeforeMethod
    public void setUp() {

        //注册本地火狐打开的位置
        System.setProperty("webdriver.gecko.driver", "C:\\Program Files\\Mozilla Firefox\\geckodriver.exe");
        //初始化
        driver = new FirefoxDriver();


    }

    @Test
    public void test() {
        driver.get("https://www.baidu.com");
    }


    @AfterMethod
    public void close() {
        driver.close();
    }
}
